import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num=Integer.valueOf(in.nextLine());
        int s[]=new int[num];
        int max=-1;
        for (int i=0;i<num;i++){
            s[i]=in.nextInt();
            if (s[i]>max){
                max=s[i];
            }
        }
        System.out.println(max);
    }
}

